<template>
    <div>
        <NavTop />
        <div class="common-layout">
            <el-container>
            <el-aside width="200px"><NavLeft @head="clickHandle"></NavLeft></el-aside>
            <el-container>
                <el-header><MySwiper></MySwiper></el-header>
                <el-main><MyList :list="list1"></MyList></el-main>
            </el-container>
            </el-container>
        </div>
    </div>
</template>

<script>
import axios from 'axios';
import NavTop from '../../components/NavTop'
import MyList from './components/MyList.vue';
import MySwiper from './components/MySwiper.vue';
import NavLeft from './components/NavLeft.vue';
export default {
    components:{
        NavTop,
        MyList,
        MySwiper,
        NavLeft
    },
    mounted(){
        axios.get('goodslist.json').then(res=>{
            this.list = res.data.goodslist
            this.list1 = this.list
        })
    },
    data() {
        return {
            list:[],
            list1:[],
        }
    },
    methods:{
        clickHandle(val){
            this.list1 = this.list.filter(v=>v.cid == val)
        }
    }
}
</script>

<style>
.el-header{
    --el-header-padding: 0 !important;
    height: 300px !important; 
}
</style>